package com.usian.search.controller.v1;

import com.usian.apis.search.ApUserSearchControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.search.dtos.UserSearchDto;
import com.usian.search.service.ApUserSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/history")
public class ApUserSearchController implements ApUserSearchControllerApi {

    @Autowired
    private ApUserSearchService apUserSearchService;

    @Override
    @PostMapping("load")
    public ResponseResult querySearchList(@RequestBody UserSearchDto dto) {
        return apUserSearchService.querySearchList(dto);
    }

    @Override
    @PostMapping("del")
    public ResponseResult delSearch(UserSearchDto dto) {
        return apUserSearchService.delSearch(dto.getId());
    }
}
